home *** CD-ROM | disk | FTP | other *** search
- package sub_arctic.constraints;
-
- /**
- * A small class to encapsulate a <value_consumer, part_number> pair.
- * @author Scott Hudson
- */
- public class consumer_part_ref {
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The consumer object. */
- public value_consumer obj;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** The part number of that object that we refer to */
- public int part_num;
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /**
- * Constructor.
- * @param value_consumer o the object consuming the value
- * @param int pn the part within that object that makes use of
- * the value
- */
- public consumer_part_ref(value_consumer o, int pn)
- {
- obj = o;
- part_num = pn;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Hash code so we can put these in hash tables. */
- public int hashCode()
- {
- return obj.hashCode() ^ part_num;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
-
- /** Comparison operator. */
- public boolean equals(Object other)
- {
- consumer_part_ref other_one;
-
- /* not equal to anything of the wrong type */
- if (!(other instanceof consumer_part_ref)) return false;
-
- /* convert and test */
- other_one = (consumer_part_ref)other;
- return other_one.obj == obj && other_one.part_num == part_num;
- }
-
- /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-